package com.eshop.modules.security.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Configuration(proxyBeanMethods = false)
@ConfigurationProperties(prefix = "jwt")
public class SecurityProperties
{
    private String header;
    private String tokenStartWith;
    private String base64Secret;
    private String secret;
    private Long tokenValidityInSeconds;
    private String onlineKey;
    private String codeKey;
    
    public String getTokenStartWith() {
        return this.tokenStartWith + " ";
    }
    
    public String getHeader() {
        return this.header;
    }
    
    public String getBase64Secret() {
        return this.base64Secret;
    }
    
    public String getSecret() {
        return this.secret;
    }
    
    public Long getTokenValidityInSeconds() {
        return this.tokenValidityInSeconds;
    }
    
    public String getOnlineKey() {
        return this.onlineKey;
    }
    
    public String getCodeKey() {
        return this.codeKey;
    }
    
    public void setHeader(final String header) {
        this.header = header;
    }
    
    public void setTokenStartWith(final String tokenStartWith) {
        this.tokenStartWith = tokenStartWith;
    }
    
    public void setBase64Secret(final String base64Secret) {
        this.base64Secret = base64Secret;
    }
    
    public void setSecret(final String secret) {
        this.secret = secret;
    }
    
    public void setTokenValidityInSeconds(final Long tokenValidityInSeconds) {
        this.tokenValidityInSeconds = tokenValidityInSeconds;
    }
    
    public void setOnlineKey(final String onlineKey) {
        this.onlineKey = onlineKey;
    }
    
    public void setCodeKey(final String codeKey) {
        this.codeKey = codeKey;
    }
    
    @Override
    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        }
        if (!(o instanceof SecurityProperties)) {
            return false;
        }
        final SecurityProperties other = (SecurityProperties)o;
        if (!other.canEqual(this)) {
            return false;
        }
        final Object this$tokenValidityInSeconds = this.getTokenValidityInSeconds();
        final Object other$tokenValidityInSeconds = other.getTokenValidityInSeconds();
        Label_0065: {
            if (this$tokenValidityInSeconds == null) {
                if (other$tokenValidityInSeconds == null) {
                    break Label_0065;
                }
            }
            else if (this$tokenValidityInSeconds.equals(other$tokenValidityInSeconds)) {
                break Label_0065;
            }
            return false;
        }
        final Object this$header = this.getHeader();
        final Object other$header = other.getHeader();
        Label_0102: {
            if (this$header == null) {
                if (other$header == null) {
                    break Label_0102;
                }
            }
            else if (this$header.equals(other$header)) {
                break Label_0102;
            }
            return false;
        }
        final Object this$tokenStartWith = this.getTokenStartWith();
        final Object other$tokenStartWith = other.getTokenStartWith();
        Label_0139: {
            if (this$tokenStartWith == null) {
                if (other$tokenStartWith == null) {
                    break Label_0139;
                }
            }
            else if (this$tokenStartWith.equals(other$tokenStartWith)) {
                break Label_0139;
            }
            return false;
        }
        final Object this$base64Secret = this.getBase64Secret();
        final Object other$base64Secret = other.getBase64Secret();
        Label_0176: {
            if (this$base64Secret == null) {
                if (other$base64Secret == null) {
                    break Label_0176;
                }
            }
            else if (this$base64Secret.equals(other$base64Secret)) {
                break Label_0176;
            }
            return false;
        }
        final Object this$secret = this.getSecret();
        final Object other$secret = other.getSecret();
        Label_0213: {
            if (this$secret == null) {
                if (other$secret == null) {
                    break Label_0213;
                }
            }
            else if (this$secret.equals(other$secret)) {
                break Label_0213;
            }
            return false;
        }
        final Object this$onlineKey = this.getOnlineKey();
        final Object other$onlineKey = other.getOnlineKey();
        Label_0250: {
            if (this$onlineKey == null) {
                if (other$onlineKey == null) {
                    break Label_0250;
                }
            }
            else if (this$onlineKey.equals(other$onlineKey)) {
                break Label_0250;
            }
            return false;
        }
        final Object this$codeKey = this.getCodeKey();
        final Object other$codeKey = other.getCodeKey();
        if (this$codeKey == null) {
            if (other$codeKey == null) {
                return true;
            }
        }
        else if (this$codeKey.equals(other$codeKey)) {
            return true;
        }
        return false;
    }
    
    protected boolean canEqual(final Object other) {
        return other instanceof SecurityProperties;
    }
    
    @Override
    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final Object $tokenValidityInSeconds = this.getTokenValidityInSeconds();
        result = result * 59 + (($tokenValidityInSeconds == null) ? 43 : $tokenValidityInSeconds.hashCode());
        final Object $header = this.getHeader();
        result = result * 59 + (($header == null) ? 43 : $header.hashCode());
        final Object $tokenStartWith = this.getTokenStartWith();
        result = result * 59 + (($tokenStartWith == null) ? 43 : $tokenStartWith.hashCode());
        final Object $base64Secret = this.getBase64Secret();
        result = result * 59 + (($base64Secret == null) ? 43 : $base64Secret.hashCode());
        final Object $secret = this.getSecret();
        result = result * 59 + (($secret == null) ? 43 : $secret.hashCode());
        final Object $onlineKey = this.getOnlineKey();
        result = result * 59 + (($onlineKey == null) ? 43 : $onlineKey.hashCode());
        final Object $codeKey = this.getCodeKey();
        result = result * 59 + (($codeKey == null) ? 43 : $codeKey.hashCode());
        return result;
    }
    
    @Override
    public String toString() {
        return "SecurityProperties(header=" + this.getHeader() + ", tokenStartWith=" + this.getTokenStartWith() + ", base64Secret=" + this.getBase64Secret() + ", secret=" + this.getSecret() + ", tokenValidityInSeconds=" + this.getTokenValidityInSeconds() + ", onlineKey=" + this.getOnlineKey() + ", codeKey=" + this.getCodeKey() + ")";
    }
}
